// 登录
var enroll=document.getElementById('enroll');
var mains = document.getElementById('mains');

enroll.onclick = function(){
	mains.style.visibility = 'visible';

}

var deletey = document.getElementById('deletey');
deletey.onclick = function(){
	mains.style.visibility = 'hidden';
}




var li1 = document.getElementById('li1');
var fly1 = document.querySelector("#url2");
// a b初始位置和结束位置
var a = -540;
var b = 350;

// 侧边
window.onscroll = function(){
	var top = document.documentElement.scrollLeft || document.body.scrollLeft || window.pageYOffset
	// 标题飞出
	if(top>300&&top<310){
		var interval1 = setInterval(function(){
			a++;
			fly1.style.marginLeft = (a+"px");
			if(a>=b){
				clearInterval(interval1);
			}
		},0.5)
	}else if(top<300){
		a = -540;
		var interval1 = setInterval(function(){
			a++;
			fly1.style.marginLeft = (a+"px");
			if(a>=b){
				clearInterval(interval1);
			}
		},0.5)
		// 侧边导航
	}else if(top<600){
		sidebar2.style.right = '-100px';
		li1.style.right = '-100px';
	}else if(top > 600 && top<1100 ) {
		sidebar2.style.right = '0px';
		li1.style.right = '0px';
		li2.style.right = '-100px';
		li3.style.right = '-100px';
	}else if(top >=1100 && top < 1600){
		li1.style.right = '-100px';
		li2.style.right = '0px';
		li3.style.right = '-100px';
	}else if(top >= 1600 && top < 1900){
		li3.style.right = '0px';
		li2.style.right = '-100px';
		li1.style.right = '-100px';
	}else if(top >= 1900 && top < 2200){		
		li3.style.right = '-100px';
		sidebar2.style.right = '0px';
	}else{
		sidebar2.style.right = '-100px';
	}
	
}
	

	

